package cn.kgc.controller;


import cn.kgc.pojo.Classify;
import cn.kgc.service.ClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品分类 前端控制器
 * </p>
 *
 * @author psq
 * @since 2021-08-05
 */
@RestController
@RequestMapping("/classify")
public class ClassifyController {
    @Autowired//可写可不写
    private final ClassifyService classifyService;

    public ClassifyController(ClassifyService classifyService) {
        this.classifyService = classifyService;
    }

    @GetMapping("all")
    public List<Classify> findAll() {
        java.util.List<Classify> list = classifyService.list();
        return list;
    }
}

